package labuladong.第三章.位操作;

public class Demo02 {
    public static void main(String[] args) {
        System.out.println(isPowerOfTwo(16));
    }

    public static boolean isPowerOfTwo(int n) {
        if (n<=0)
            return false;
        return (n & (n-1)) == 0;
    }
}
